import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
 routes: [

  // 首页
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home.vue'),
    redirect: '/login'
  },
  // 登录页面
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/login.vue')
  },
    // Dashboard
    // {
    //   path: '/dashboard',
    //   name: 'dashboard',
    //   component: () => import('@/views/login/login.vue')
    // },
    // 系统管理
    {
      path: '/system',
      name: 'system',
      redirect:'/system/sysUser',
      component: () => import('@/views/sidebar.vue'),
      children:[
        // 用户管理
        {
          path:'/system/sysUser',
          name:'sysUser',
          component: () => import('@/views/system/sysUser.vue')
        },
        // 角色管理
        {
          path:'/system/sysRole',
          name:'sysRole',
          component: () => import('@/views/system/sysRole.vue')
        },
        // 菜单管理
        {
          path:'/system/sysMenu',
          name:'sysMenu',
          component: () => import('@/views/system/sysMenu.vue')
        },
        //部门管理
        {
          path:'/system/sysDept',
          name:'sysDept',
          component: () => import('@/views/system/sysDept.vue')
        },
        // 岗位管理
        {
          path:'/system/sysPost',
          name:'sysPost',
          component: () => import('@/views/system/sysPost.vue')
        },
        // 日志管理
        {
          path:'/system/log',
          name:'sysLoginLog',
          redirect:'/system/log/sysLoginLog',
          children:[
            // 登录日志
            {
              path:'/system/log/sysLoginLog',
              name:'sysloginLog',
              component: () => import('@/views/system/systemLog/sysLoginLog.vue'),
            },
            // 操作日志
            {
              path:'/system/log/operaLog',
              name:'operaLog',
              component: () => import('@/views/system/systemLog/sysOperLog.vue'),
            }
          ]
        },
      ]
    },
    //审批设置
    {
      path: '/processSet',
      name: 'processSet',
      component: () => import('@/views/sidebar.vue'),
      redirect:'/processSet/processTemplate',
      children:[
        // 审批模板
        {
          path:'/processSet/processTemplate',
          name:'processTemplate',
          component: () => import('@/views/processSet/processTemplate.vue')
        },
        // 审批类型
        {
          path:'/processSet/processType',
          name:'processType',
          component: () => import('@/views/processSet/processType.vue')
        }
      ]
    },
    // 审批列表
    {
      path:'/processMgr',
      name:'process',
      redirect:'/processMgr/process',
      component: () => import('@/views/sidebar.vue'),
      children:[
        {
          path:'/processMgr/process',
          name:'process',
          component: () => import('@/views/processMgr/process.vue')
        }
      ]
    },
    // 公众号菜单
    {
      path:'/wechat',
      name:'menu',
      component: () => import('@/views/sidebar.vue'),
      children:[
        {
          path:'/wechat/menu',
          name:'menu',
          component: () => import('@/views/wechat/menu.vue')
        }
      ]
    },
  ]
})

export default router
